package licode.unisop.provider.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

/**
 * 定义资源信息（仅仅保存资源ID）
 *
 * @author licode
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString(callSuper = true)
public class SiAssetInfo implements Serializable {
    private static final long serialVersionUID = 562221663400281803L;

    private String targetId;

    /**
     * 具有树形关系的资源集合
     */
    private List<SiAssetTKey> trees;

    /**
     * 所有资源集合
     */
    private Map<String, SiAsset> assets;

    /**
     * 拥有的资源集合
     */
    private Map<String, List<SiAssetKey>> holds;

    public boolean hasHolds() {
        return (null != holds && !holds.isEmpty());
    }

    public boolean hasAssets() {
        return (null != assets && !assets.isEmpty());
    }

    public boolean hasTrees() {
        return (null != trees && !trees.isEmpty());
    }
}
